Collaborative systems allow documents to be created and edited online by collaborating users in real-time. A user can share a document with other users and the users can work together as a group in editing the document. Users can also edit the shared document concurrently. Further, each user can make changes to the shared document in a coordinated fashion. Each user can also view changes made to the shared document by other users in real-time. The collaborative system can also maintain consistency of the shared document even as the various users make changes to the document.
To create a collaborative working environment, the different clients in a collaborative system must share and negotiate their respective operational changes to a document. In some collaborative systems operational changes are shared and implemented by clients on a peer-to-peer basis. Here, the different clients in the collaborative system send their respective operations to each other. To maintain consistency, each client must consequently maintain an order of operations, including their respective operations and those of the other clients. This allows each client to determine when to apply each operation to avoid errors and inconsistencies in the data.
Each client can maintain an order of operations using a vector clock, which refers to an algorithm for generating an order of events in a distributed system, and detect causality violations. Specifically, each client can use its vector clock to calculate a respective order of operations from the perspective of the respective client. Because each client must maintain a separate order of operations, the current collaborative systems must, at some point, re-order all of the operations from the different clients. However, this requires additional operations, and places a great burden on the collaborative system. Moreover, the different ordering of operations at the clients constrains the flexibility of operations and capabilities of the collaborative system. As a result, users are limited in their collaborative experience.